// dao/userSqlMapping.js
// CRUD SQL语句
var user = {
    insert:'INSERT INTO user(name, password,sex,address,number) VALUES(?,?,?,?,?)',
    update:'update user set name=?, age=? where id=?',
    delete: 'delete from user where id=?',
    queryById: 'select * from user where id=?',
    queryCount:"select count(*) as count from user where name like concat('%',?,'%') or password like concat('%',?,'%') or sex like concat('%',?,'%') or address like concat('%',?,'%') or number like concat('%',?,'%')",
    queryAll: 'select * from user',
    queryNum:"select * from user where name like concat('%',?,'%') " +
                "or password like concat('%',?,'%') " +
                "or sex like concat('%',?,'%') " +
                "or address like concat('%',?,'%') " +
                "or number like concat('%',?,'%')" +
                " ORDER BY id DESC limit ?,? ",
    login:'select name from user where name=? and password=?'
};

module.exports = user;